package com.adcc.msgsimulator.dto;

import com.adcc.msgsimulator.base.BaseConverter;
import com.adcc.msgsimulator.bo.Msg618BO;
import com.adcc.msgsimulator.entity.Msg618DO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;


@Mapper(componentModel = "spring")
public interface Msg618Converter extends BaseConverter<Msg618BO, Msg618DO> {

    // 实例
    Msg618Converter INSTANCE = Mappers.getMapper(Msg618Converter.class);

    @Mappings({@Mapping(source = "id", target = "id"),
            @Mapping(source = "msgID", target = "msgID"),
            @Mapping(source = "recvTime", target = "recvTime"),
            @Mapping(source = "depTime", target = "depTime"),
            @Mapping(source = "msgType", target = "msgType"),
            @Mapping(source = "station", target = "station"),
            @Mapping(source = "tail", target = "tail"),
            @Mapping(source = "agency", target = "agency"),
            @Mapping(source = "flightNum", target = "flightNum"),
            @Mapping(source = "label", target = "label"),
            @Mapping(source = "subLabel", target = "subLabel"),
            @Mapping(source = "smi", target = "smi"),
            @Mapping(source = "bi", target = "bi"),
            @Mapping(source = "tak", target = "tak"),
            @Mapping(source = "msn", target = "msn"),
            @Mapping(source = "msgLength", target = "msgLength"),
            @Mapping(source = "msg", target = "msg")})
    Msg618BO toBO(Msg618DO o);

    @Mappings({@Mapping(source = "id", target = "id"),
            @Mapping(source = "msgID", target = "msgID"),
            @Mapping(source = "recvTime", target = "recvTime"),
            @Mapping(source = "depTime", target = "depTime"),
            @Mapping(source = "msgType", target = "msgType"),
            @Mapping(source = "station", target = "station"),
            @Mapping(source = "tail", target = "tail"),
            @Mapping(source = "agency", target = "agency"),
            @Mapping(source = "flightNum", target = "flightNum"),
            @Mapping(source = "label", target = "label"),
            @Mapping(source = "subLabel", target = "subLabel"),
            @Mapping(source = "smi", target = "smi"),
            @Mapping(source = "bi", target = "bi"),
            @Mapping(source = "tak", target = "tak"),
            @Mapping(source = "msn", target = "msn"),
            @Mapping(source = "msgLength", target = "msgLength"),
            @Mapping(source = "msg", target = "msg")})
    Msg618DO toDO(Msg618BO o);

    List<Msg618BO> toBOList(List<Msg618DO> list);

    List<Msg618DO> toDOList(List<Msg618BO> list);
}
